<script setup lang='ts'>
import { ref, watch } from 'vue';

const count = ref(0)
watch(count, (newValue, oldValue) => {
    console.log(newValue, oldValue)
})
</script>

<template>
    <h1>Watch最简单用法</h1>
    <button @click="count--">-</button>
    <span>{{ count }}</span>
    <button @click="count++">+</button>
</template>

<style scoped></style>